using Godot;

public class Vector3I
{
    public int X;
    public int Y;
    public int Z;




    public static Vector3I Up = new Vector3I(0, 1);
    public static Vector3I Down = new Vector3I(0, -1);
    public static Vector3I Left = new Vector3I(-1, 0);
    public static Vector3I Right = new Vector3I(1, 0);


    public Vector3I(int X, int Y, int Z = 0)
    {
        this.X = X;
        this.Y = Y;
        this.Z = Z;
    }
    public Vector3I(float X, float Y, float Z = 0)
    {
        this.X = (int)X;
        this.Y = (int)Y;
        this.Z = (int)Z;
    }
    public Vector3I(Vector2 v2, int z = 0)
    {
        this.X = (int)v2.x;
        this.Y = (int)v2.y;
        this.Z = z;
    }
    public Vector3I(Vector3 v3)
    {
        this.X = (int)v3.x;
        this.Y = (int)v3.y;
        this.Z = (int)v3.z;
    }
    public void MoveUp() => Y += 1;
    public void MoveDown() => Y -= 1;
    public void MoveRight() => X += 1;
    public void MoveLeft() => X -= 1;
    public Vector3I ToUp() => new Vector3I(X, Y + 1, Z);
    public Vector3I ToDown() => new Vector3I(X, Y - 1, Z);
    public Vector3I ToLeft() => new Vector3I(X - 1, Y, Z);
    public Vector3I ToRight() => new Vector3I(X + 1, Y, Z);

    public static Vector3I operator +(Vector3I v1, Vector2I v)
    {
        return new Vector3I(v1.X + v.X, v1.Y + v.Y, v1.Z);
    }
    public static Vector3I operator +(Vector3I v1, Vector3I v)
    {
        return new Vector3I(v1.X + v.X, v1.Y + v.Y, v1.Z + v.Z);
    }
    public static Vector3I operator -(Vector3I v1, Vector3I v)
    {
        return new Vector3I(v1.X - v.X, v1.Y - v.Y, v1.Z - v.Z);
    }
    public static Vector3I operator *(Vector3I v1, Vector3I v)
    {
        return new Vector3I(v1.X * v.X, v1.Y * v.Y, v1.Z * v.Z);
    }
    public static Vector3I operator *(Vector3I v1, int v)
    {
        return new Vector3I(v1.X * v, v1.Y * v, v1.Z * v);
    }
    public static Vector3I operator /(Vector3I v1, Vector3I v)
    {
        return new Vector3I(v1.X / v.X, v1.Y / v.Y, v1.Z / v.Z);
    }
    public static Vector3I operator /(Vector3I v1, int v)
    {
        return new Vector3I(v1.X / v, v1.Y / v, v1.Z / v);
    }
    public static bool operator ==(Vector3I v1, Vector3I v)
    {
        if (v1 is null || v is null) return false;
        return (v1.X == v.X && v1.Y == v.Y && v1.Z == v.Z);
    }
    public static bool operator !=(Vector3I v1, Vector3I v)
    {
        if (v1 is null || v is null) return false;
        return v1.X != v.X || v1.Y != v.Y || v1.Z != v.Z;
    }
}